refactoring exercise 003.py