Just an idea, I don't know what you think.. instead of item instanceof Placeholder and persistToDB we could add a attribute called "type" for instances and item.type === 'placeholder' or item.type === 'collection' or item.type === 'bookmark', ....