Use the type system instead of explicit `asInstanceOf`