First pass at table driven tag handling rather than using case statements