code refactor, and async signup