better login and logout structure