refactoring: detect page name in layout instead of view part 2