Move common lines to plugin