first step of refactoring