cleaned up main, moved file upload to classes