Moved and added the File creation code