Updated JS structure to the new style