Replace plugin-specific code with action hooks to improve extensibility