refactored code using authentication process from Twitter gem