Refactoring some classes