Refactor JavaScript code