extraction of files reader + refactoring