refactor to call .data() rather than group().all()