Swapping is_a() with instanceof