refactor login & getMessage