Cleaned up DTLS and threads