Lift lambdas to top level functions if they are disabled