Refactoring; updated benchmark.