Code cleaning for paginator