Highlight current page, and some refactoring.