use parser classes to encapsulate parsing code (although getFieldIndex is redundant).