Rewrite lambda function as a static method