Cleanup & tweak perf a bit