update js code
clean up code