extract method which build name value pairs.