finish sse2 optimizations refactoring