Fix pagination bug & optimize views