Pimping up some of the code

to make it more readable