Cast as instance and class