fixed dispatcher testcase
variable naming and various cleanups