Move logic into Trial