separate functions from streams