Refactoring scripts twitter.php