Refactor twitter login process