refactor Facebook library