detect collection types (close #12)
fix delete_item (close #11)
minor refactorings