Some code maintenance and style tinkering