better separation between PatternWriter and collector - should be easier
for newcomers, btw