Cleans up the code to match the blog post
Turn graph data into a stream as well