Rework of login controller