added all sorts of fancy rename, delete, replace, safety guards