some refactoring of AddUserPanel