refactor purgerequest