refined to meet jshint requirements