Using only document internal IDS for versioning. Code cleanup