complete refactor of the relay functionality, and pulling related weeds