Did some minor refactoring on string_reduction.