Begin refactoring plugin to add new functionality