change delete with predicate function to class method