Refactored model class