refactoring 1st part