some minor speedup and test cleanup