added factory to allow a single point to switch implementation
Merge commit 'ff4d0157967e1682e5e53456fd304199628c6c3d' into generic_baas