optimization for multi processing