Code style improvements: attempt to be more idiomatic.