refactored a little, pages and index page is now included