Removes unnecessary rules