Move pagination to layout