ContainerBuilder: fix format statement of methods in factories

#977