The sanitizing function ensures that the returned type is always the correct type. This eliminates warnings without extra casts.