Refactor account creation to allow external index