Moved all the file i/o to the general file
Further improved the general file IO