relay: minor refactorings