refactoring to make it pretty, step 1