extracted controller class