Refactoring for readability, enabling jshint strict mode