Large code clean-up.