Restructured configure function for control.