Refactored nlp_nlidb