small refactor

Minor refactor per Andrei's suggestion. No semantic changes.