cleanup and tests for hash ns