update code to use simple json