refactoring some classes