refactor in lambdas