tidied up code style