Started refactoring the submission process. Progress so far only on document submission.