MODE-1822 Improvements to previous commit as recommended by code review