centralize and abstract parsing chores