Some improvements to StreamBuilder class