replaced lambda function with type