refactor some common elements into includes, fix bug in menu with fetching current page