refactor how the .env.production template is generated