start JS code re-organization