Clean up and simplify submit script.