Refactor the code to simplify and move common code into a method. Add
comments. Make use of the gohandy env package to get environment variables.