replaced 'instanceof' with tests on 'type' attribute in WireframeHelper

following #4776 

2 removed, 378 to go...