Main framework for ctrl.