remove unused index, use element arg in filter function