Partial cleanup of twitter code