move json functions to it's own file
remove obsolete includes
declaring a variable one time is enough