foreshadow refactoring