add some more perf tweaks, profile looks promising