Refactoring out Twitter API specific functionality