Wow. Made pwp_msghandler.c easier to read
Refactoring