formatting and minor improvements