add filter for items to prevent duplicates, refactor tests