relay: add some more docs and cleanup