refactors a lot, but doesn't delete yet the old files
ready to clean up
does the clean up