Add AMD module and refactor setup.