workding on invitation refactor