Reduced cyclomatic complexity in doctor_nlg and increased documentation