Do you use boolean type here intentionally? I tend not to change the type of object at runtime.