Javascript refactoring done and pagination library changed