moving routing logic into receiver