3.7: improve key, value stuff