starting to refactor dispathcer