Refactor code for Create Accountability Groups