Refactor for abstract factory repository class derivation