move secret creation to factory