code refactor for add user and edit user views

merge the code of add user and edit user views
into single file