refactor pagination mixin