remove lambda, use helper function