[MAGEMEP-131] Cleaning code and improve preview loading