Move dispatch logic into connection