generalize for all collections