Reduce direct dependency on environment variables

This way I can run tests that run this method directly and without setting the
environment variable (it is set in Rakefile).