Refactor tests from scaffolding.