set some defaults and clean up