mostly done refactoring two classes into one