refactored twitter code to object oriented approach