Refactored some classes