refactor: move read file to a new class