Refactored parts of NLP