refactored fb authentication method