convert inline lambda function to old-style function