sp fixes, rearrange a bit