Simplify some json handling.