Moved demo form processing into stand alone functions.