Using a Match Expression Instead of isInstanceOf