code clean up
plugin refactoring to new architecture