s2w s2s fixes, code cleanup