[TASK] Refactor and comment loop to resolve page template configuration