improve javascript lib