Refactoring example in Python.