Optimize Log In/Out for mobile