Revamped ipnhandler code.