removal of unwanted references