Refactoring twitter controller