refactored Relay into Router