Refactor and improve User sign up code