Use factory to simplify config.