Refactoring... moving code to FOCommon.