refactor catalog.version to do more O(1) stuff