Major refactor of cyder delete js