Examples of refactored code