Significant performance boost for multiple target elements

end of refactoring