remove unwanted refs