DRYer code for passport config