refactoring configuration to use app.set instead of global object