Extract provisioning serialization to separate class

ready for review

tested by hand