Refactor some classes