Refactor profile page templates for extensibility