code cleanup per suggestions from @awoods