Refactoring: Introduced SqlDocumentStore for holding all statement processing stages that can be reused by various functions