restructure plugin and fix import issue