Refactor Dispatcher class
Changes:
- Made getcontroller function dynamic