Reimplemnet the strcture of login