small perf improvements