Refactored Passport plugin