refactoring the code to be a real knife plugin