cleanup and polish on pagination