perf(view-factory): loop optimization