some refactoring in the PrefixNSService