Complete refactoring of Passport implementation