General tidy up and remove debug messages no longer needed