add options and clean up.