refactor common functionality of chunk streaming classes