Moved model utilities into model module.