switch from flags to environment variables