A system and a method for management of diabetes are provided. The system includes an infusion pump, glucose sensor, and controller that is programmed to control insulin delivery based upon at least one stored variable. The controller calculates a maximum insulin delivery rate based on the default basal insulin delivery rate, temporary basal insulin delivery rate, extended bolus rate, or a combination thereof.