refactoring to attempt to make 1 method do 1 thing