Switched logging from info to debug and tidied up