Fix bugs when removing Twitter. Further refactors.