Refactor to opts model.