Cleaned up code in facebook.js and map.js