refactoring spd