add test for removing optional item and list of items and refactoring after test