suggestion: instead of a normal cast, I suggest using `Class.asSubclass`