build with the right key and value types