first refactoring step
further refactoring