file renaming and cleanup