improved twitter.pl code