Cleanup of chunk handling and chunk quality reducing code.