Refactored atom-to-ref