first refactoring finished