cleanup
fix order of ops in setting persist
prototype