Cohorts rebase

Rebase for multiple cohorts changes and fixing tests

cc @antoviaque