-- refactoring plugin to work with new architecture