The optical characterization of materials in thin film phase is a standard task in the field of coating technology. One typical problem is the optical characterization of a single layer of material deposited on a well-known substrate. Provided the physical model considered for the modeling is correct and the available experimental data (usually spectrophotometric or ellipsometric spectra) are accurate, a precise optical characterization is quite straightforward. However, there are experimental circumstances where several samples have been coated under very well defined conditions, as when they have been obtained in the same coating run, so that no differences are expected due to the positions of each individual sample inside the chamber during the deposition process. The aim of this work is to present an improved procedure for the optical characterization of the material deposited under the very well controlled conditions explained above. The basis of our method is to use the 'a priori' information about the identical nature of all the samples, introducing all the spectrophotometric and/or ellipsometric data available from measurements into a global optimization procedure. This leads to a unique determination of the parameters that define the optical properties of the layers, as compared with the separate (individual) characterization of the samples. We will illustrate our procedures for MgF2 films in the range 200-800 nm.