Refactoring of UploadPin done. no tests.