main controller class