refactor passport config and database config