Change JSON object manipulation, should lead to more safe and short code.