re-factored code for the forms (login, register, edit users)