updated to use router and main template