first refactoring done