js delete tidy up