perf(all): minor loop optimization