refactoring code not completed: added persistence options