Refactor squatting detector