Expand the JS code a bit to prepare for networking code