tidied it all up a bit