Tidied up some scripts