Refactored code to use lambdas