refactored based on plugin template
Merge pull request #311 from giulianoriccio/master

refactoring