Rework the Templates and cleanups