Generalize with let bindings instead of equations