refactor so that actions do not explicitly use streams