Refractoring isLogged()