various changes to support rename.