first refactoring #2