Only load persistence if not embedded.
Remove redundant 'embedded' parsing
minor: move utility function inside