Slight refactor, no change to logic