Optimization: removing unnecessary collects