move javascript responsible for creating files into seperate module
move some javascript into a custom module