Replace filter pattern with labmda expression and filter function.