Should `escapeFn` be a local var here?