Refactored the classes.