add login function, rename some classes