refactors formatFeed to lower average complexity