Refactored facebook.js to gather smaller chunks at a time