Refactor js (prep for hiding toolboxes)