lots of minor improvements