refactor base Model class