moved register field groups code to plugin class