refactor login namespace