if we make this a re-usable function, we could DRY this up a bit (and the above location).