Its always good to sit down before actually writing the code and think about organization. How you do so is up to you, but its a good idea to try and do so with some concepts in mind, one of which is the concept of code re-use. Its nice to have implementations that can be separated into their own objects and potentially used in aanother project without the dependency of the current project. This is also where 'loose' implementations come into play such as using interfaces and abstract classes, where one class or function doesn't depend upon a defined single class but rather an 'empty' implementation, which facilitates code-reuse. As a more semi-concrete example, one could create a class that represents the file you wish to read/write. All you need to do is create an object of that class, then access the variables you wish