(#284) Refactored after review from @nulltoken

- built up expected canonical name of HEAD
- excluded this in where method of the foreach enumeration