* small refactoring
* make jshint happy
* code formatting