Refactor the key value pairing parser