Some refactoring, effects, and stated xp handler