Resolve merge conflicts in template extraction code