some code cleanup
Fixed a potential issue with lambdas returning multiple expressions