Refactored Model class.