refactor AMD wrapper/crapper