refactoring base Model class