refactor(pagination): simplify math