tidied things up a bit