spin refactored, but still doesn't play nice with sonar