Handle different types of streams