[IMP] improve javascript side code.