basic refactoring works