modularize wfs processing