Refactored Facebook plugin to use object factories.