Refactor Twitter demo project