[PR] Cleanup JS to reuse a couple cached elements