cleaner JS
More minor refactor