Extracted duplicate pagination method into module