refactoring early exercises