try to improve lambda function