adding delete to testrun, and making it smart (delete references)