refactors the twitter handling