Refactor. Logout. 401 redirect