Refactored lessons controller