refactor the program under the guidence of node-login