Refactored forms to no longer have global variables.