Refactored a few classes for readability