Cleaned up paginator code