refactoring respond_to