Refactored for --ref-format

- Also list UUIDs in same way as we list paths