Start work on delete and restructure the js bits