Massive code clean-up.