Moved a method into GeneralFunctions