Refactor more JS.