remove respond_to from MainController and refactoring