cleaned up PatternReader