removing unnecessary pages