DRY after/before scope which were defined in multiple difference
locations.
Add some sanity checks.