Reworked preFilterImplementation so tht its more genereic and extensible (it can easily support sessions in many ways)