refactored some classes