this improvement looks like it could be more widely applied; perhaps it's worth a code cleanup ticket