Refactoring how classes are stored for easier maintainability