Stream utils refactored