AdRem: An Integrated Approach for Adaptive Remediation