Avoid using lambdas in ?: expression