Improve copying of secrets