Refactors thanks to cespare
Removes tls config variable