first round refactoring