Refactor entity effect undo control