Deleting unnecessary references