improved login/logout unit testing