Refactor ndrive.login