Fixed up code formatting
Refactored onAfter[X] logic to centralize overriding