major refactor step 2