refactor nss