JS optomization working