Would it be better to refactor the knife code to be more testable? Looks like this duplicates the logic from the knife code...