making db model instance friendly