refactoring kermit