Checking for type instead of variable existence