updating code to work with esprima generated models