Refactoring onePageNav plugin