Improving existing invitation logic