Refactor the input uploads a bit