Cleanup: Expose repeated process_template()

process_template() is used in several files across all the
project, so extracting this will help with future refactoring
looking forward easing code maintenance.