Move file related operations into a module