refactored the passport config and tweaked a few functions to take all their dependencies