refactor login, register and forgotpassword module