refactoring: make the code jslint friendly.