Moved useful functions to Model base