hamt: refactor/nlc