Simplified code dealing with file read/write operations
Merge branches 'master' and 'refactor'