Refactoring and some modifications to behavior to better support removal
of items
Modifications to behavior and minor refactoring.