refactoring to clean up the code a bit