refactor trial model.