Refactored a few classes