Refactor some things
Add dispatcher