some post-expansion clean up