Remove redundant stuff and orphan instances