- Extracted captureKeys and listRange into tools.js