Small fix and simple multiprocesing refactoring