Refactored the classes to make them more readable.