Refacotor for usage with new persistence container functionality