Make initialization optional when using logout.
Simplify polymorphic check.