Use streams instead of string concatenation

This is of course regarding #2.