minor code improvements per Brandon's suggestions