Cleaning unused references