factored out a bit of how the earthtools call works