Move submission to a function.