minor improvements to code, no functional changes