move around template list discovery code called from layout.

this makes for better extensibility
typo