more refactoring to clean up class structure