Refactoring of lessons 1 and 2