Improved snippet in AsInstanceOf