Separated functions, required for sequential and parallel algorithms

It makes compilation under Visual Studio easier.
However under Linux it makes no difference.