Replaced all uses of pagination to use the function instead of singleton object