refactor upload session a little