Refactored for theme plugin ability