refactor and new nlp heuristics