Refactor join group