Improving work upload page, moving code into functions.