Optimizing the templates file and using SecureRandom.uuid to generate uuid