MOre refactoring to nmdbase.