Refactoring done for container.rb