Finish conversion to use gorm.