Refactor #upload & #validate