changed datasource to use document for persisting data
merged changes