Refactor the coap request