loggedin instance variabe and calback refactor