Major overhaul of the QA code.