Refactoring. Starting work on benchmarking.