Converted most of quantum to shared module.