improve javascript