remove duplicates from aliased ids
make sure to check of portal_factory exsists, not installed by default in plone 5