Refactoring for HandlerType

Still not complete
IsClient parameter capability implemented

Slight optimizations and organizations