[TASK] Further simplify page template resolving loop