Rewrote EffectAPI for clarity and efficiency