refactor read.js to export single method