#fixed #49 and refactorized code: i created FileHelper class in order to encapsulate file operations