Major code clean-up.