An attempt at some Perf improvements