Making handling datagrams a bit more flexible