Factorizing common functions into ncipnamespace.

To avoid duplication of efforts in future maintenance.