Refactor signup handler a bit.