Refactor error loading feed function