Refactor again using a generator and standard all() function instead of the previous approach (OMS-339)