Refactoring and fixing klocks