a few attempts to improve perf