Big refactoring in K-control