Refactor MDSParser.