Refactoring CoAP.