layout and template changes--refactored to run off one main template