simplify code
Merge pull request #5452 from guardian/refactoring

Quick JS refactoring