Added javascript optimization