Avoid the use of InstanceOf inside loops | CAST Appmarq