compact and clean up