I think that you should put `$factory` in constructor and given the `$base_url` in here, not whole config.