Refactored according to JSLint requirements.