refactor read from file, commenting