move set function out of persistance library