Refactor to pass jslint.