factoring out components from original templates