Tidied things up a lot.