refactored passport module and server.js file