New Designed Code added for main page and template