Refactored the AMD setup.