refactor to use apply_options