can't say if it's the *most* efficient, but definitely better than the existing solution ;)