Cleaned up util functions to reduce the usage of reduce.
Cleaned up util functions to reduce the usage of reduce.

GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp,GoogleForCreators/web-stories-wp