Moved duplicate code into a new custom model manager.