JS simplification proposed.