Metabolic factors that affect beta cell function and survival