code refactor for member registration api