Add close detection to the sample, fix regression
Refactor, no functional change