Simplify persistent storage code logic