match javascript code to new datastructure