Working login/logout from interface
Some minor cleanup