made some helper methods in controller private