TestHandler heavy refactoring.
TestHandler minor refactoring.