refactor per Gabe's suggestions