Replace getClass with inquiry of objectspace