Some optimization, less lambdas