Replace 'plugins' with 'generator' and code cleanup