Refactor ContainerListener