Refactor Relay to External Script

Refactored Relay interaction into it's own external script