effects: reorganized to do preprocessing