cleanup for json handling.