General cleanup and added benchmarks