Refactored for Protege plugin work