First cut refactoring