refactoring facebook and output