Address more feedback: CohortFactory and perf optimization