No point in calling key.len() 3 times in a row when 1 suffices