Clean up SPM implementation.