various small cleanup improvements