Refactored several classes.