Cleaning up code to work when you aren't running a jenkins job.