refactor some classes