refactor read write and build
use jshint check code