rearrange code so each controller is responsible for its own stuff and add main controller to manage all controllers.