clone action implemented in JS, refactored delete JS to not share code with clone