NEMO-1838 Cleaned up nested conditional