use immutable data structure `filter` instead of `splice` to delete an
item