core simpl: lambda refactor free vars cut into seprate fns