Refactored all algorithm unit tests to reduce complexity