     typealias InstructionsByModifier = [String: InstructionsByToken]
     
     override func string(for obj: Any?) -> String? {
+        return string(for: obj, modifyValueByKey: nil)
+    }
+    
+    func string(for obj: Any?, modifyValueByKey: ((TokenType, String) -> String)?) -> String? {
         guard let step = obj as? RouteStep else {
             return nil
         }

            // Set wayName
            let name = step.names?.first
            let ref = step.codes?.first
            if let name = name, let ref = ref, name != ref {
                wayName = "\(name) (\(ref))"
            } else if name == nil, let ref = ref {
                wayName = ref
            } else {
                wayName = name ?? ""
            }
        }


class OSRMInstructionFormatter: Formatter {
    let version: String
    let instructions: [String: Any]
    
    enum TokenType: String {
        case wayName = "way_name"
        case destination = "destination"
        case rotaryName = "rotary_name"
        case exit = "exit_number"
        case laneInstruction = "lane_instruction"
        case modifier = "modifier"
        case direction = "direction"
        case wayPoint = "way_point"
    }
    
    let ordinalFormatter: NumberFormatter = {
        let formatter = NumberFormatter()
