Refactor JavaScript for Clients section.