refactored pagination into a partial