In situ surfactant generation as a means of miniemulsification