Is this logic the same as with the ODM? Should we encapsulate it in a class?