refactoring login pages to use main template