Refactoring LessonQuery, LessonManager