You could refactor with 2 method that would help lisibility:
* `isSameNamespace`
* `isSameLocale`