refactored facebook login