refactoring pt1
refactoring pt2