Tidied up AMD and map.