JS code optimiser created