parse key value into a hash