Dispatcher Refactoring

Refactor dispatcher: dispatch() in turns call a new function dispatch_internal()