Retrieve factories and database via service container.