Clean-up and simplification of submit script.