Refactored some classes.