Removes unused references