code lesson refactoring