more template (container) code cleanups