extract count stream into its own module