Tidied up some of the file creator code, separated into method