avoid raw types where possible in json handling