* fix duplicate code fragment
* code formatting
* code formatting
* make jshint happy