MODE-2018 Made several improvements following a code review