Delicious cleanup

No actual change in functionality, just basically a load of tidying :)