trim whitespace from key and value