Remove dependency on container, removing service locator antipattern

fix #8016