Move this to Utils.