Adds streaming interface, needs testing and better organization