Tidied up the code

Fixed whitespace and put certain properties in different order for more
readablity.