Cleaned up and refactored model classes and added comments.