Factory pattern for Request and Database objects