Complete migrating and modifying IfFormatValid() function. (overloading not complete)