formatting JS code