Refactor login page and fix facebook login bugs