Small refactor of NEI detection.
Fix up javadocs a bit.