the begining of refactoring