refactor fixes, always need to set persistence template