modify not to use `letfn`