Refactored code to match coding style better

I refactored your code a bit to better match the coding style of the dotdetector project. As a bonus you get some changes to the ddclient.