Some refactoring of burrow detection