Refactoring lambda handling and transforms to handle lambdas created
inside other lambdas.