Refactor model classes