clean up js codes