Initial refactoring of the pkg/template towards to templateConfig