Tidy up trace#edit and trace#delete and make them more consistent