merging the template and breaking up into managable chunks