or how to survive type-casting