converted to plugin with options