Tidied up several utilities and testing dome