refactored, added plugin