first round refactor