Refactored openMP