refactored some js.