moved stream definitions out of main and into their own file