cleaned up stream api