1. refine the callback for performing the effects
2. move the platform-independent effects code where it belongs