A whole bunch of little modifications to make the code cleaner and the style more beautiful. The behaviour stays untouched.