Small refactoring exercise