using closures, but should use also pointers to Json values...