Revert "Update the js to apply new data format"

Reinstate changes lost during mentioned commit

This reverts parts of commit 0b88028536a91d8541fe7c712a644f2c473e5d07.