Rough refactor to extract kv values from expressions instead of from byte arrays.