Improve perf a bit