refactored some code into base classes