Extract provisioning serialization to separate class

ready for review