code tidy as guided by jshint