improve java script