fixes #1 perf improvements