Or maybe even make this a helper function since it's repeated here and there :-)