Re-organized internal dispatcher.

Added comments in internal classes.