Move writing of module file into own method