Better upload code