The dilute nitride (GaIn)(NAs) material system grown lattice matched to GaAs or Ge with a 1eV band gap is an interesting material for the use in four-junction solar cells with increased efficiencies. As a result of its metastability, several challenges exist for this material system, which up to now limits the device performance. We performed nanostructural analysis in combination with photoluminescence characterization to optimize the metal organic vapor phase growth as well as the annealing conditions for the quaternary solar cell material. The optimum annealing conditions depend strongly on the In content of the quaternary material. Valence force field calculations of stable N environments in the alloy support the model that the N moves from a Ga rich environment realized during growth into an In rich environment upon annealing. Simultaneously, N induced strain fluctuations, which are detected in the N containing material upon growth, are dissolved and the device properties are improved.