more cleanup for ami prep