Implemented dispatch table, instead of switch-case usage.