Pagination added
Refactoring