update and clean up js