Removing dead code, refactoring afterscenario hook.