Classification and construction of relays