Refactoring a facebook method.