refactor group joining to verify group code