a bunch of trivial changes relating to mem/perf