Remove all unused references