Extracting the container functionalities into a method