pull out KeyValuePair as top-level class