added new controller and refactored