Use letfn for internal recursion