Refactored to include plugin architecture