set client secret and id as environment variables and tidy the code