address code review comments and jshint the test